<?php 
	require_once("utils.php");
	require_once("obj/session.php");
	require_once("obj/user.php");
	require_once("obj/taskpriority.php");
	
	$list = TaskPriority::getAll();
?>
<a href="<?php echo Utils::makeTaskPriorityDetailUrl(0); ?>">New</a>
<table class="datatable" width="100%" cellpadding="5" cellspacing="0">
<tr><th>Name</th><th>Description</th><th>Position</th><th>&nbsp;</th></tr>
<?php
	$ix = 0;
	foreach($list as $obj){
		$i = $obj->TaskPriorityId; 
		$n = $obj->Name;
		$d = $obj->Description;
		$p = $obj->Position;
		$u = Utils::makeTaskPriorityDetailUrl($i);
		$cs = $ix % 2 == 0 ? "row" : "altrow";
		echo "<tr class=\"$cs\"><td>$n</td><td>$d</td><td>$p</td><td><a href=\"$u\">Edit</a></td></tr>";
		$ix++;		
	}
?>
</table>
<?php echo count($list)." rows"; ?>